{{ header }}
<div id="product-search" class="container">
  <ul class="breadcrumb">
    {% for breadcrumb in breadcrumbs %}
      <li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
    {% endfor %}
  </ul>
  <div class="row">{{ column_left }}
    <div id="content" class="col">{{ content_top }}
      <h2>{{ heading_title }}</h2>
      {% if products %}
        <div id="display-control" class="row">
          <div class="col-md-3">
            <div class="mb-3">
              <a href="{{ compare }}" id="compare-total" class="btn btn-primary d-block"><i class="fas fa-exchange-alt"></i> <span class="d-inline d-md-none d-lg-inline">{{ text_compare }}</span></a>
            </div>
          </div>
          <div class="col-md-1 d-none d-md-block">
            <div class="btn-group">
              <button type="button" id="list-view" class="btn btn-light" data-toggle="tooltip" title="{{ button_list }}"><i class="fas fa-th-list"></i></button>
              <button type="button" id="grid-view" class="btn btn-light" data-toggle="tooltip" title="{{ button_grid }}"><i class="fas fa-th"></i></button>
            </div>
          </div>
          <div class="col-md-4 offset-md-1 col-6">
            <div class="input-group mb-3">
              <div class="input-group-prepend">
                <label class="input-group-text" for="input-sort">{{ text_sort }}</label>
              </div>
              <select id="input-sort" class="form-control" onchange="location = this.value;">
                {% for sorts in sorts %}
                  {% if sorts.value == '%s-%s'|format(sort, order) %}
                    <option value="{{ sorts.href }}" selected="selected">{{ sorts.text }}</option>
                  {% else %}
                    <option value="{{ sorts.href }}">{{ sorts.text }}</option>
                  {% endif %}
                {% endfor %}
              </select>
            </div>
          </div>
          <div class="col-md-3 col-6">
            <div class="input-group mb-3">
              <div class="input-group-prepend">
                <label class="input-group-text" for="input-limit">{{ text_limit }}</label>
              </div>
              <select id="input-limit" class="form-control" onchange="location = this.value;">
                {% for limits in limits %}
                  {% if limits.value == limit %}
                    <option value="{{ limits.href }}" selected="selected">{{ limits.text }}</option>
                  {% else %}
                    <option value="{{ limits.href }}">{{ limits.text }}</option>
                  {% endif %}
                {% endfor %}
              </select>
            </div>
          </div>
        </div>
        <div class="row">
          {% for product in products %}
            <div class="product-layout product-list col-12">
              <div class="product-thumb">
                <div class="image"><a href="{{ product.href }}"><img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-fluid"/></a></div>
                <div>
                  <div class="caption">
                    <h4><a href="{{ product.href }}">{{ product.name }}</a></h4>
                    <p>{{ product.description }}</p>
                    {% if product.price %}
                      <p class="price">
                        {% if not product.special %}
                          {{ product.price }}
                        {% else %}
                          <span class="price-new">{{ product.special }}</span> <span class="price-old">{{ product.price }}</span>
                        {% endif %}
                        {% if product.tax %} <span class="price-tax">{{ text_tax }} {{ product.tax }}</span>
                        {% endif %}
                      </p>
                    {% endif %}
                    {% if product.rating %}
                      <div class="rating">
                        {% for i in 1..5 %}
                          {% if product.rating < i %}
                            <span class="fas fa-stack"><i class="fas fa-star-o fa-stack-2x"></i></span>
                          {% else %}
                            <span class="fas fa-stack"><i class="fas fa-star fa-stack-2x"></i><i class="fas fa-star-o fa-stack-2x"></i></span>
                          {% endif %}
                        {% endfor %}
                      </div>
                    {% endif %}
                  </div>
                  <div class="button-group">
                    <button type="button" onclick="cart.add('{{ product.product_id }}', '{{ product.minimum }}');"><i class="fas fa-shopping-cart"></i> <span class="d-none d-lg-inline">{{ button_cart }}</span></button>
                    <button type="button" data-toggle="tooltip" data-placement="top" title="{{ button_wishlist }}" onclick="wishlist.add('{{ product.product_id }}');"><i class="fas fa-heart"></i></button>
                    <button type="button" data-toggle="tooltip" data-placement="top" title="{{ button_compare }}" onclick="compare.add('{{ product.product_id }}');"><i class="fas fa-exchange-alt"></i></button>
                  </div>
                </div>
              </div>
            </div>
          {% endfor %}
        </div>
        <div class="row">
          <div class="col-sm-6 text-left">{{ pagination }}</div>
          <div class="col-sm-6 text-right">{{ results }}</div>
        </div>
      {% else %}
        <p>{{ text_no_results }}</p>
        <div class="d-inline-block pt-2 pd-2 w-100">
          <div class="float-right"><a href="{{ continue }}" class="btn btn-primary">{{ button_continue }}</a></div>
        </div>
      {% endif %}
      {{ content_bottom }}
    </div>
    {{ column_right }}
  </div>
</div>
{{ footer }}
